import { Inject, Provide } from '@midwayjs/core';
import { Printer, PrinterUltra } from './provider.service';
export class Shower {
  //   printer: Printer = new Printer();
  //   name:string = "zhangsan"
  printer: Printer;
  //   constructor() {
  //     this.printer = new Printer();
  //   }
  constructor(printer: Printer) {
    this.printer = printer;
  }
  show() {
    //  99
    // const printer = new Printer();
    // printer.print();
    console.log('将要打印99乘法表');
    this.printer.print();
  }
  showEx() {
    // const printer = new Printer();
    console.log('将要打印99乘法表');
    this.printer.printEx();
  }
  //   对象的属性不仅是 大包小 属性组成对象 同时也是联系方式
  //   对象的属性 ==又称之为依赖 属性赋值== 依赖注入
  //   chutou:ChuDou
  //   location :="room 5566"
  //   lanzi :=new array<>
  //   zhangssan:firendly=

  //   wakuang(){
  // ssss

  //   }
}
@Provide('showerUltra')
export class ShowerUltra {
  @Inject('printerUltra')
  printerUltra: PrinterUltra;
  show() {
    //  99
    // const printer = new Printer();
    // printer.print();
    console.log('将要打印99乘法表');
    this.printerUltra.print();
  }
}
